﻿@model List<TJBHJJ.Models.News>
@{
    //ViewBag.Title = "公司动态";
    //Layout = "~/Views/Shared/_Layout.cshtml";

    int pagecount = (int)ViewData["pageCount"];
    int pageindex = (int)ViewData["pageIndex"];
}
<h2>
    公司动态</h2>
@foreach (var v in Model)
{
    if (v != null)
    {
    <p>
        @Ajax.ActionLink(v.Title.Length > 25 ? v.Title.Substring(0, 25) + "..." : v.Title, "Detail",
                                                                    new
                                                                    {
                                                                        page = pageindex,
                                                                        id = v.Id
                                                                    },
                                                                    new AjaxOptions
                                                                    {
                                                                        UpdateTargetId = "ShowContent",
                                                                        InsertionMode = InsertionMode.Replace
                                                                    })
    </p>
    }
}
<div class="inner2">
    @Ajax.ActionLink("上一页", "Index", new { page = pageindex > 0 ? pageindex - 1 : 0 }, new AjaxOptions
                                                           {
                                                               UpdateTargetId = "ShowList",
                                                               InsertionMode = InsertionMode.Replace
                                                           })
    @Ajax.ActionLink("下一页", "Index", new { page = pageindex < pagecount ? pageindex + 1 : pagecount }, new AjaxOptions
                                                           {
                                                               UpdateTargetId = "ShowList",
                                                               InsertionMode = InsertionMode.Replace
                                                           })
    当前是第@(pageindex + 1)页，共@(pagecount + 1)页 @*    @Ajax.ActionLink("[首页]", "Index", new { page = 0 }, new AjaxOptions { UpdateTargetId = "ShowList", InsertionMode = InsertionMode.Replace })
    @for (int i = 1; i < pagecount; i++)
    {
        if (i == pageindex)
        {
        <strong>@Ajax.ActionLink("[" + i + "]", "Index", new { page = i }, new AjaxOptions { UpdateTargetId = "ShowList", InsertionMode = InsertionMode.Replace })</strong>
        }
        else
        {
        @Ajax.ActionLink("[" + i + "]", "Index", new { page = i }, new AjaxOptions { UpdateTargetId = "ShowList", InsertionMode = InsertionMode.Replace })
        }
    }
    @Ajax.ActionLink("[末页]", "Index", new { page = pagecount }, new AjaxOptions { UpdateTargetId = "ShowList", InsertionMode = InsertionMode.Replace })
*@</div>
